package com.ovopark.organize.server.common.exception;

/**
 * 请求异常的枚举类  后期所有code 这里维护
 */
public enum ExceptionEnum {

    SUCCESS("0","SUCCESS"),
    ERROR("1","ERROR"),
    PARAM_ERROR("-1","PARAM_ERROR"),
    RESULT_FAILED("-2","RESULT_FAILED"),
    INVALID_TOKEN("-3","INVALID_TOKEN"),
    SIGNATURE_ERROR("-4","SIGNATURE_ERROR"),
    USER_NOT_EXIST("-5","USER_NOT_EXIST"),
    NO_PRIVILEGE("99990001","NO_PRIVILEGE"),

    /**
     * 设备相关10000
     */

    DEVICE_EXIST("4","DEVICE_EXIST"),
    NO_DATA("100004","NO_DATA"),
    DEVICE_NOT_SUPPORTED("10000","DEVICE_NOT_SUPPORTED"),
    DEVICE_OFFLINE("10001","DEVICE_OFFLINE"),
    DEVICE_EXCEED_LIMIT("10002","DEVICE_EXCEED_LIMIT"),
    DEVICE_LOW_MEMORY("10003","DEVICE_LOW_MEMORY"),
    DEVICE_BUSY("10004","DEVICE_BUSY"),
    DEVICE_NOT_EXIST ("10005","DEVICE_NOT_EXIST"),
    DEVICE_REGISTERED("10006","DEVICE_REGISTERED"),
    DEVICE_VERSION_NOT_EXIST("10007","DEVICE_VERSION_NOT_EXIST"),
    DEVICE_INVALID("10008","DEVICE_INVALID"),
    DEVICE_INITIALIZED("10009","DEVICE_INITIALIZED"),
    DEVICE_CHANNEL_FULL("10010","DEVICE_CHANNEL_FULL"),
    DEVICE_UPGRADE_IN("10011","DEVICE_UPGRADE_IN"),
    DEVICE_INSTALL_IN("10012","DEVICE_INSTALL_IN"),
    DEVICE_RESULT_FAILED("10013","DEVICE_RESULT_FAILED"),
    DEVICE_SEARCH_FAILED("10014","DEVICE_SEARCH_FAILED"),
    REQUEST_TIMEOUT("10015","REQUEST_TIMEOUT"),
    SOCKET_TIMEOUT("10019","SOCKET_TIMEOUT"),
    DEVICE_NO_PERMISSION("10016","DEVICE_NO_PERMISSION"),
    RESULT_DUPLICATE("10017","RESULT_DUPLICATE"),
    VERSION_ALREADY_EXISTS("10018","VERSION_ALREADY_EXISTS"),
    JSON_ERR("10021","JSON_ERR"),
    RESULT_NOT_SUPPORTED("10031","RESULT_NOT_SUPPORTED"),
    PLATFORM_IS_NULL("10032","PLATFORM_IS_NULL"),
    DEVICE_IS_MAPPING("10033","DEVICE_IS_MAPPING"),
    MEDIA_SERVER_CONFIG_IS_NOT_EXIT("10034","MEDIA_SERVER_CONFIG_IS_NOT_EXIT"),
    DEVICE_GB_SERIAL_NO_OVERLENGTH("10035","DEVICE_GB_SERIAL_NO_OVERLENGTH"),
    OUT_OF_SERVICE("10036","OUT_OF_SERVICE"),
    XXL_JOB_ADD_FAIL("10037","XXL_JOB_ADD_FAIL"),

    TOKEN_NOT_EXIT("9990001","TOKEN_NOT_EXIT"),
    TOKEN_EXPIRATION("9990002","TOKEN_EXPIRATION"),
    /**
     * 平台相关20000
     */
    PLATFORM_NOT_EXIST("20000","PLATFORM_NOT_EXIST"),

    /**
     * 门店相关30000
     */
    SHOP_NOT_EXIST("30000","SHOP_NOT_EXIST"),


    /**
     * 异常错误
     */
    RESULT_EXCEPTION("99999","RESULT_EXCEPTION"),
    CLOUD_EXCEPTION("199999","CLOUD_EXCEPTION"),

    //重名
    NAME_DUPLICATE("40000","NAME_DUPLICATE"),

    ;

    private String code;
    private String message;

    ExceptionEnum(String code, String message){
        this.code = code;
        this.message = message;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}